<!--
 * @Author: Bobby
 * @Date: 2021-12-30 10:01:42
 * @LastEditTime: 2022-02-16 17:39:25
 * @LastEditors: Bobby
 * @Description:
 * @FilePath: \wms-v2\src\project\bobby\views\index.vue
 * CIMC-V2
-->
<template>
  <div class="index-container">
    <button class="rounded-sm bg-gray-500 p-1" @click="demo">生成dom</button>
    <div v-for="(item, i) in jsonData" :key="i" class="bg-gray-50 mt-2">
      <!-- <el-switch v-model="index" /> -->
      <el-button>Socket1{{ item.name }}</el-button>
      <!-- <el-tag class="ml-2" type="success">Tag 2</el-tag>
      <el-tag class="ml-2" type="info">Tag 3</el-tag>
      <el-tag class="ml-2" type="warning">Tag 4</el-tag>
      <el-tag class="ml-2" type="danger">Tag 5</el-tag> -->
    </div>
  </div>
</template>

<script>
  import { defineComponent } from 'vue'
  export default defineComponent({
    name: 'Socket2',
    data() {
      return {
        index: true,
        num: 2000,
        jsonData: [],
      }
    },
    updated() {
      console.timeEnd('测试时间')
    },
    methods: {
      demo() {
        console.log('次数')

        let arr = []
        for (let i = 0; i <= this.num; i++) {
          arr.push({
            name: `组件${i}`,
          })
        }
        this.jsonData = arr
        console.time('测试时间')
      },
    },
  })
</script>

<style lang="scss" scoped></style>
